package com.vanke.gankclient.base

import android.app.Fragment
import android.databinding.ViewDataBinding
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup

/**
 * @name GankClient
 * @package name：com.vanke.gankclient
 * @class describe
 * @anthor shiyuchuan
 * @time 2017/8/10 15:29
 */
abstract class BaseBindingFragment<B: ViewDataBinding> : Fragment(){

    lateinit var mBinding: B
    override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View {
        mBinding = createDataBinding(inflater,container,savedInstanceState)
        initView()
        return mBinding.root
    }

    abstract fun initView()

    abstract fun createDataBinding(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): B

    override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
    }


}